<?php
class Application_Form_Scheduler extends Zend_Form
{
	public function init()
	{
		$this->setName('scheduler');
		
		$scheduler = new Application_Model_DbTable_Scheduler();
		
		$campaigns = $scheduler->getAllCampaign();
		
		$campaign = new Zend_Form_Element_Select('campaign_id');
		$campaign->setMultiOptions($campaigns);
		$campaign->setLabel('Campaign')->setRequired(true);
		
		$lists = $scheduler->getAllListContact();
		
		$list = new Zend_Form_Element_MultiCheckbox('list_ids');
		$list->setMultiOptions($lists);
		$list->setLabel('List')->setRequired(true);

		$sendTime = new Zend_Form_Element_Text('sending_time');
		$sendTime->setRequired(true)->setLabel('Sending Time');
		
		$smpt = new Zend_Form_Element_Text('smtp_id');
		$smpt->setRequired(true)->setLabel('Smtp');
		
		$token = new Zend_Form_Element_Hidden('token');
		$token->setRequired(true);
				
		$submit = new Zend_Form_Element_Submit('submit');
		$submit->setAttrib('id', 'submitbutton')->setLabel('Submit');

		$this->addElements(array($campaign, $list, $sendTime, $smpt,
				 $token, $submit));
	}
}